var CountDown = new Class({

  //implements
  Implements: [Options,Events],

  //options
  options: {
//    element: 'countdown',
//    start: 10,
//    finish: 0,
//    startFont: '10px',
//    finishFont: '10px',
//    onComplete: $empty,
//    duration: 1000
  },
  
  //initialization
  initialize: function(options) {
    //set options
    this.setOptions(options);
  },
  
  //get things started
  start: function() {
    this.anim();
  },
  
  //animate!
  anim: function() {
	var time = this.options.start,
		stop = time == 0,
		countdown = {
			time: this.options.start,
		};
	countdown.minutes = Math.floor(time / 60);
	countdown.second = time % 60;
	if(countdown.minutes<10)countdown.minutes ='0'+countdown.minutes;
	if(countdown.second<10)countdown.second ='0'+countdown.second;	
    this.options.element.set('text',countdown.minutes+':'+countdown.second);
	this.options.start--;	
	
    var fx = new Fx.Tween(this.options.element,{
      duration: this.options.duration,
      link: 'ignore',
	  transition: 'linear',
      onComplete: function() {
        if(this.options.start >= this.options.finish) {
          this.anim();
        } else {
          this.fireEvent('complete');
        }
      }.bind(this)
    }).start('font-size','14px','14px');//have to hard coded beause startFont in IE is not working this.options.startFont,this.options.finishFont);
  }
});